package test;

import java.util.Arrays;

public class ArrayTest1 {
	public static void main(String[] args) {
		test1();
	}

	public static void test1() {
		int[] a = { 1, 2, 3, 4, 5 };
		String[] s = { "1", "2" };
		// Object[] b = (Object[]) a; 编译错误
		Object[] b2 = (Object[]) s;
		System.out.println(Arrays.asList(a));// [[I@2d95bbec] 整个int[]被当做是1个对象,所以转换成了List<int[]>而不是List<int>或者List<Integer>
 		System.out.println(a);// [I@3781efb9 
 		System.out.println(s);// [Ljava.lang.String;@33a17727
		System.out.println(Arrays.asList(s));// [1, 2]
		System.out.println(Arrays.asList(1, 2, 3, 4, 5));// [1, 2, 3, 4, 5]
		System.out.println(Arrays.asList(new Integer[] { 1, 2, 3, 4, 5 }));// [1, 2, 3, 4, 5]

	}
}
